﻿@using ZhouYu.NewWorld.Model;
@{
    Layout = null;
    var ScenicspotList = ViewBag.Scenicspotlist;
    var HotelList = ViewBag.HotelList;
    var CityList = ViewBag.CitylList;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="renderer" content="webkit|ie-comp|ie-stand" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link href="~/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="~/css/style.css" />
    <link href="~/assets/css/codemirror.css" rel="stylesheet" />
    <link rel="stylesheet" href="~/assets/css/ace.min.css" />
    <link rel="stylesheet" href="~/font/css/font-awesome.min.css" />
    <link href="~/layui-v2.5.4/layui/css/layui.css" rel="stylesheet" />
    <link href="~/layui-v2.5.4/layui/css/modules/layer/default/layer.css" rel="stylesheet" type="text/css" />
    <!--[if lte IE 8]>
      <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
    <![endif]-->
    <script src="~/Scripts/jquery-1.9.1.min.js"></script>
    <script src="~/assets/js/bootstrap.min.js"></script>
    <script src="~/assets/js/typeahead-bs2.min.js"></script>
    <script src="~/assets/js/jquery.dataTables.min.js"></script>
    <script src="~/assets/js/jquery.dataTables.bootstrap.js"></script>
    <script src="~/assets/layer/layer.js" type="text/javascript"></script>
    <script src="~/assets/laydate/laydate.js" type="text/javascript"></script>
    <script src="~/Scripts/Format.js" type="text/javascript"></script>
    <script src="~/layui-v2.5.4/layui/layui.js" type="text/javascript"></script>
    <script src="~/static/TouristRoute/TouristRouteIndex.js" type="text/javascript"></script>@*引入页面Jquery代码*@
    <title>旅游路线管理</title>
</head>

<body>
    <div class="margin clearfix">
        <div class="" id="Other_Management">
            <div class="search_style">

                <ul class="search_content clearfix">
                    <li><label class="l_f">路线名称</label><input name="" id="WhereTable" type="text" class="text_add" placeholder="" style=" width:400px" /></li>
                    <li style="width:90px;"><button type="button" id="TableReload" class="btn_search"><i class="fa fa-search"></i>查询</button></li>
                </ul>
            </div>
            <div class="border clearfix">
                <span class="l_f">
                    <button id="AddTouristroute" class="btn btn-danger">&nbsp;添加&nbsp;</button>
                </span>
                <span class="l_f">
                    <a id="DelListByID" class="btn btn-danger"><i class="fa fa-trash"></i>&nbsp;批量删除</a>
                </span>
                <span class="r_f">共：<b>2345</b>条</span>
            </div>
            <!--右侧-->
            <div class="right" id="Rigth" style="display:none">
                <fieldset class="layui-elem-field layui-field-title">
                    <legend id="rigthName">添加路线</legend>
                </fieldset>
                <div id="divContext">
                    <input type="hidden" value="" name="Id" id="Id" />
                    <div class="layui-form-item" style="width:60%">
                        <label class="layui-form-label">产品编号</label>
                        <div class="layui-input-block">
                            <input type="text" name="ProductNumber" id="ProductNumber" required=required lay-verify="required" placeholder="" autocomplete="off" class="layui-input" />
                        </div>
                    </div>
                    <div class="layui-form-item" style="width:80%">
                        <label class="layui-form-label">路线名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="TName" id="TName" required=required lay-verify="required" placeholder="" autocomplete="off" class="layui-input" />
                        </div>
                    </div>
                    <div class="layui-form-item" style="width:60%">
                        <label class="layui-form-label">出发地</label>
                        <div class="layui-input-block" style="margin-left:120px;">
                            <span class="select-box">
                                <select style="height:40px;width:240px" class="select" id="OutPlace" name="OutPlace">
                                    <option value="0">--请选择--</option>
                                    @foreach (var item in @CityList)
                                    {
                                        <option value="@item.City">@item.City</option>
                                    }
                                </select>
                            </span>
                        </div>
                    </div>
                    <div class="layui-form-item" style="width:60%">
                        <label class="layui-form-label">结束地</label>
                        <div class="layui-input-block" style="margin-left:120px;">
                            <span class="select-box">
                                <select style="height:40px;width:240px" class="select" id="OverPlace" name="OverPlace">
                                    <option value="0">--请选择--</option>
                                    @foreach (var item in @CityList)
                                    {
                                        <option value="@item.City">@item.City</option>
                                    }
                                </select>
                            </span>
                        </div>
                    </div>
                    @*<div class="layui-form-item" style="width:60%">
                            <label class="layui-form-label">出发地</label>
                            <div class="layui-input-block">
                                <input type="text" name="OutPlace" id="OutPlace" required=required lay-verify="required" placeholder="" autocomplete="off" class="layui-input" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="width:60%">
                            <label class="layui-form-label">结束地</label>
                            <div class="layui-input-block">
                                <input type="text" name="OverPlace" id="OverPlace" required=required lay-verify="required" placeholder="" autocomplete="off" class="layui-input" />
                            </div>
                        </div>*@
                    <div class="layui-form-item">
                        <label class="layui-form-label">持续时长</label>
                        <div class="layui-input-block" style="margin-left:120px;">
                            <span class="select-box" style="width:150px;">
                                <!--admin-role-->
                                <select style="height:40px;width:20%" class="select" id="Duration" name="Duration" size="1">
                                    <option value="2">2天</option>
                                    <option value="3">3天</option>
                                    <option value="5">5天</option>
                                    <option value="7">7天</option>
                                </select>
                            </span>
                        </div>
                    </div>
                    <div class="layui-form-item" style="width:60%">
                        <label class="layui-form-label">选择景点</label>
                        <div class="layui-input-block" style="margin-left:120px;">
                            <span class="select-box">
                                <!--admin-role-->
                                <select style="height:40px;width:240px" class="select" id="ScenicSpotId" name="ScenicSpotId">
                                    <option value="0">--请选择--</option>
                                    @foreach (var item in @ScenicspotList)
                                    {
                                        <option value="@item.Id">@item.ScenicName</option>
                                    }
                                </select>
                            </span>
                        </div>
                    </div>
                    <div class="layui-form-item" style="width:60%">
                        <label class="layui-form-label">酒店</label>
                        <div class="layui-input-block" style="margin-left:120px;">
                            <span class="select-box" style="width:150px;">
                                <!--admin-role-->
                                <select style="height:40px;width:240px" class="select" id="HotelId" name="HotelId" size="1">
                                    <option value="0">--请选择--</option>
                                    @foreach (var item in @HotelList)
                                    {
                                        <option value="@item.HotelId">@item.HotelName</option>
                                    }
                                </select>
                            </span>
                        </div>
                    </div>

                    <form class="layui-form ">
                        <div class="layui-form-item" id="isvip">
                            <label class="layui-form-label">主题</label>
                            <div class="layui-input-block">
                                <input type="checkbox" value="1" id="IsThemeTour" name="IsThemeTour" checked="" lay-text="是|否" lay-skin="switch"  lay-filter="switchEnable"  />
                            </div>
                        </div>
                    </form>

                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">价格</label>
                    <div class="layui-input-block" style="width:150px">
                        <input type="text" name="Price" id="Price" required=required lay-verify="required" placeholder="" autocomplete="off" class="layui-input" />
                    </div>
                </div>
                <div class="layui-form-item" style="width:60%">
                    <label class="layui-form-label">上架时间</label>
                    <div class="layui-input-block">
                        <input type="text" name="TDate" id="TDate" placeholder="" autocomplete="off" class="layui-input" />
                    </div>
                </div>
                <div class="" style="width:60%">
                    <label class="layui-form-label">出团日期</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input" name="OutDate" id="OutDate" placeholder="" autocomplete="off" />
                    </div>
                </div>
                @*<input type="hidden" id="ThemeTour" value="" />*@
                @*<div class="layui-form-item" style="width:60%;margin-top:12px">
                        <label class="layui-form-label">线路介绍</label>
                        <div class="layui-input-block">
                            <input type="text" name="RouteIntroduce" id="RouteIntroduce" required=required lay-verify="required" placeholder="" autocomplete="off" class="layui-input" />
                        </div>
                    </div>*@
                <div class="form-group">
                    <label class="form-label" style="margin-top:50px;padding-right:10px">线路介绍</label>
                    <div class="formControls" style="margin-left:6%;margin-top:15px">
                        <textarea name="RouteIntroduce" id="RouteIntroduce" cols="" rows="" class="textarea" placeholder="线路介绍...200个字符以内" dragonfly="true" onkeyup="checkLength(this);"></textarea>
                        <span class="wordage">剩余字数：<span id="sy" style="color:Red;">200</span>字</span>
                    </div>
                    <div class="col-4"> </div>
                </div>

                <div class="layui-form-item" style="margin-top:20px">
                    <div class="layui-input-block">
                        <input type="button" id="commit" value="立即提交" class="layui-btn" lay-submit=lay-submit lay-filter="submit" />
                    </div>
                </div>
            </div>
        </div>
        <div class="list_style">
            <table class="layui-hide" id="test" lay-filter="demo"></table>
            <script type="text/html" id="barDemo">
                <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
            </script>

            <script type="text/html" id="switchTpl">
                <!-- 这里的 checked 的状态只是演示 -->
                <input type="checkbox" id="{{d.Id}}" name="sex" value="{{d.IsThemeTour}}" lay-skin="switch" lay-text="是|否" lay-filter="sexDemo" {{ d.IsThemeTour == 1 ? 'checked' : '' }}={{ d.IsThemeTour == 1 ? 'checked' : '' }} />
            </script>
        </div>

    </div>
</body>
</html>
<script>
    jQuery(function ($) {
        var oTable1 = $('#sample-table').dataTable({
            "aaSorting": [[1, "desc"]],//默认第几个排序
            "bStateSave": true,//状态保存
            "aoColumnDefs": [
                //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
                { "orderable": false, "aTargets": [0, 2, 3, 6] }// 制定列不参与排序
            ]
        });


        $('table th input:checkbox').on('click', function () {
            var that = this;
            $(this).closest('table').find('tr > td:first-child input:checkbox')
                .each(function () {
                    this.checked = that.checked;
                    $(this).closest('tr').toggleClass('selected');
                });

        });
    });
    /*用户-删除*/
    function member_del(obj, id) {
        layer.confirm('确认要删除吗？', function (index) {
            $(obj).parents("tr").remove();
            layer.msg('已删除!', { icon: 1, time: 1000 });
        });
    }
    //积分浏览
    function integration_history(id) {
        layer.open({
            type: 1,
            title: '积分获取记录',
            area: ['800px', '400px'],
            shadeClose: true,
            content: $('#integration_history'),
        })
        $('#integration_history_list').dataTable({
            "aaSorting": [[1, "desc"]],//默认第几个排序
            "bStateSave": true,//状态保存
            "aoColumnDefs": [{
                "bSortable": false,
                "orderable": false,
                "aTargets": [0, 1]
            }]
        });

    };
    //浏览记录

    function Browse_history(id) {
        layer.open({
            type: 1,
            title: '浏览记录',
            area: ['800px', '400px'],
            shadeClose: true,
            content: $('#Browse_history'),
        })
        $('#Browse_history_list').dataTable({
            "aaSorting": [[1, "desc"]],//默认第几个排序
            "bStateSave": true,//状态保存
            "aoColumnDefs": [{
                "bSortable": false,
                "orderable": false,
                "aTargets": [0, 1]
            }]
        });
    }


    //购物记录
    function Order_history(id) {
        layer.open({
            type: 1,
            title: '购物记录',
            area: ['800px', '400px'],
            shadeClose: true,
            content: $('#Order_history'),
        });
        $('#Order_history_list').dataTable({
            "aaSorting": [[1, "desc"]],//默认第几个排序
            "bStateSave": true,//状态保存
            "aoColumnDefs": [{
                "bSortable": false,
                "orderable": false,
                "aTargets": [0, 1]
            }]
        });
    }


</script>
<script>
    //执行一个laydate实例  时间控件
    laydate({
        elem: '#OutDate' //指定元素
    });
    laydate({
        elem: '#TDate' //指定元素
    });
</script>
<script>
    //字数限制
    function checkLength(which) {
        var maxChars = 200; //
        if (which.value.length > maxChars) {
            layer.open({
                icon: 2,
                title: '提示框',
                content: '您输入的字数超过限制!',
            });
            // 超过限制的字数了就将 文本框中的内容按规定的字数 截取
            which.value = which.value.substring(0, maxChars);
            return false;
        } else {
            var curr = maxChars - which.value.length; //250 减去 当前输入的
            document.getElementById("sy").innerHTML = curr.toString();
            return true;
        }
    };
</script>
